var ajaxError = function (XMLHttpRequest, textStatus, errorThrown) {
    switch (XMLHttpRequest.status){
        case 422:
            var errors=XMLHttpRequest.responseJSON.errors;
            var content='';
            $.each(errors,function (key,value) {
                $.each(value,function (i,item) {
                    content+='<br>'+item
                })
            });
            break;
        case 403:
            var content=XMLHttpRequest.responseJSON.message;
            break;
    }
    layer.alert('提交失败<br>'+content, {icon: 5});
};
